 <%=javascript_include_tag :all-%>
<%form_tag :action=>"sign_up" do-%>
<div style="clear:both;margin:10px 30px 10px 10px;padding:10px;line-height:200%">
              <div>University : <%=select_tag :university, options_for_select(University.find(:all).collect{|x| [x.name, x.stripped_name]}), :class => "search" %></div>
              <%unless @user_type.user_profile_form_field.nil? -%>
              
                <%@attributes.each do |form_field| -%>
                  <div id="<%=form_field[:input_type][1]%>">
                    
                    <%=form_field[:label]-%> :
                  
                    <%=send(form_field[:input_type][0], "profile_attributes[#{form_field[:input_type][1]}]", form_field[:input_type][3],:onclick=>"javascript:test(this.value,this.id)")-%>
                  </div>
               
                <%end -%>
              <%end -%>
              <%=submit_tag-%>
 </div>
 <%end -%>
<script type="text/javascript" language="javascript">
       $("bba_specialization").style.display="none";
       $("bsc_specialization").style.display="none";
       $("ba_specialization").style.display="none";
       $("ba_hons_specialization").style.display="none";
       $("be_btech_specialization").style.display="none";
       $("mbbs_specialization").style.display="none";
       $("mbbs_specialization").style.display="none";
       $("bachelors_course").style.display="none";
       $("masters_course").style.display="none";
       $("ma_specialization").style.display="none";
       $("mcom_specialization").style.display="none";
       $("mba_pgdm_specialization").style.display="none";
       $("msc_specialization").style.display="none";
       $("me_mtech_specialization").style.display="none";
       $("mphil_specialization").style.display="none";
       function test(value,id){

         if (value=="bba")
         {
             $("bba_specialization").style.display="block";
             $("bsc_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
    
         }
         else if(value=="bsc")
           {
             $("bsc_specialization").style.display="block";
             $("be_btech_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";

           }
         else if(value=="ba")
           {
             $("ba_specialization").style.display="block";
             $("be_btech_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";

           }

         else if(value=="ba_hons")
           {
             $("ba_hons_specialization").style.display="block";
             $("be_btech_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";

           }

         else if(value=="be_btech")
           {
             $("be_btech_specialization").style.display="block";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";

           }
         else if(value=="mbbs")
           {
             $("mbbs_specialization").style.display="block";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";


           }
         else if(value=="ma")
           {
             $("ma_specialization").style.display="block";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";


           }
         else if(value=="mcom")
           {
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="block";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
           }

         else if(value=="mba_pgdm")
           {
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="block";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
           }
          else if(value=="msc")
           {
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="block";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
           }
           else if(value=="me_mtech")
           {
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="block";
             $("mphil_specialization").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
           }
           else if(value=="mphil")
           {
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="block";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
           }
         else if(value=="bachelors_course")
           {
             $("bachelors_course").style.display="block";
             $("masters_course").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
           }

         else if(value=="masters_course")
           {
             $("bachelors_course").style.display="none";
             $("masters_course").style.display="block";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
           }
         else if (id=="profile_attributes_course_type")
           {
             $("bachelors_course").style.display="none";
             $("masters_course").style.display="none";
             $("mbbs_specialization").style.display="none";
             $("be_btech_specialization").style.display="none";
             $("ba_hons_specialization").style.display="none";
             $("ba_specialization").style.display="none";
             $("bsc_specialization").style.display="none";
             $("bba_specialization").style.display="none";
             $("ma_specialization").style.display="none";
             $("mcom_specialization").style.display="none";
             $("mba_pgdm_specialization").style.display="none";
             $("msc_specialization").style.display="none";
             $("me_mtech_specialization").style.display="none";
             $("mphil_specialization").style.display="none";
           }
        
       }
</script>